package cn.shyouchi.wuguanjia.android.ui.search;

import android.content.Context;
import android.content.Intent;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseActivity;
import cn.shyouchi.wuguanjia.android.ui.search.thread.SearchResultFragment;
import cn.shyouchi.wuguanjia.android.widget.TopBar;

public class SearchResultActivity extends BaseActivity {


    @BindView(R.id.topBar)
    TopBar mTopBar;

    SearchResultFragment mFragment;

    public static void start(Context context, String category, String keyWord) {
        Intent intent = new Intent(context, SearchResultActivity.class);
        intent.putExtra("cate", category);
        intent.putExtra("key", keyWord);
        context.startActivity(intent);
    }

    @Override
    public int initContentView() {
        return R.layout.activity_search_result;
    }

    @Override
    public void initInjector() {

    }

    @Override
    public void initUiAndListener() {
        ButterKnife.bind(this);
        mFragment = (SearchResultFragment) getSupportFragmentManager().findFragmentById(R.id.search_res);
        mTopBar.setLeftIcon(R.mipmap.ic_back);
        mTopBar.setTitle(getTitle().toString());
        setSupportActionBar(mTopBar.getToolbar());
        mFragment.search("", "");

    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean isApplyStatusBarColor() {
        return true;
    }


}
